//SamXIAO
#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926
#define   SQUARE(x) ((x)*(x))
//double SQUARE(double x) { return x*x;}

long long f[100]={1,1,2,3};

void w1()
{
	int n, k, ans=0, y, h, w;
	char c;
	scanf("%d", &n);
	int num = 1;
	for(;n>0;){
		num++;
		bool isPrime = true;
		for(int i=2; i*i<=num; i++){
			if(0 == num % i){
				isPrime = false;
				break;
			}
		}
		if(isPrime) n--;
	}
	printf("%d", num);
}

int main()
{
	w1();
  return 0;
}
